package org.dreamwork.jasmine2.sample;

import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: seth
 * Date: 2008-12-30
 * Time: 11:10:32
 */
public class Item implements Serializable {
    private int id;
    private String title;
    private Data data;

    public int getId () {
        return id;
    }

    public void setId (int id) {
        this.id = id;
    }

    public String getTitle () {
        return title;
    }

    public void setTitle (String title) {
        this.title = title;
    }

    public void setData (Data data) {
        this.data = data;
    }

    public Data getData () {
        if (data == null) {
            data = new Data ();
            data.setValue (title + "[" + id + "]");
        }
        return data;
    }

    public static final class Data {
        private String value;

        public void setValue (String value) {
            this.value = value;
        }

        public String getValue () {
            return value;
        }
    }
}
